/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 */

import { RestoolCompressionConfig } from '../options/build/build-opt.js';

/**
 * RestoolConfigBuilder和RestoolCommandBuilder需要实现的接口类
 *
 * @since 2022/7/4
 */
export interface RestoolBuilderInterface {
  addInputVariantDir(inputVariantDir: string): RestoolBuilderInterface; // -b
  addInputDir(inputDir: string, inputType?: string): RestoolBuilderInterface; // -i
  addJsonFile(jsonFile: string): RestoolBuilderInterface; // -j
  addModulePackName(packName: string): RestoolBuilderInterface; // -p
  addOutputDir(outputDir: string): RestoolBuilderInterface; // -o
  addResTable(resTable: string): RestoolBuilderInterface; // -r
  forceDelete(): RestoolBuilderInterface; // -f
  incremental(): RestoolBuilderInterface; // -c
  compressImage(): RestoolBuilderInterface;

  setIconCheck(enable: boolean): RestoolBuilderInterface;

  addOutputBak(outputBak: string): RestoolBuilderInterface; // -n
  addModules(modules: string): RestoolBuilderInterface; // -m
  addStartId(startId: string): RestoolBuilderInterface; // -e
  addIdsPath(idsPath: string): RestoolBuilderInterface; // -ids
  addDefinedIds(definedIds: string): RestoolBuilderInterface; // --defined-ids
  addDefinedSysIds(definedIds: string): RestoolBuilderInterface;

  /**
   * 【参数 -d】 Fa模型 feature编译时需要依赖entry模块的资源编译结果
   * 这里传entry资源编译结果目录, 例: .\entry\build\default\intermediates\res\default
   */
  addEntryCompiledResource(inputDir: string): RestoolBuilderInterface;

  // Restool增量方式编译，实现并使用以下接口
  addAppScopeResourcesDir(inputDir: string): RestoolBuilderInterface;

  addModuleResourcesMap(map: Map<string, string>): RestoolBuilderInterface;

  addHarResourcesMap(map: Map<string, string>): RestoolBuilderInterface;

  incrementalCompile(): RestoolBuilderInterface; // -z
}

export interface OptCompressionBuilderInterface {
  setResourceDirArr(resourceDirArr: string[]): OptCompressionBuilderInterface;

  setCompressionConfig(config: RestoolCompressionConfig | undefined): OptCompressionBuilderInterface;

  setExtensionPath(extensionPath?: string): OptCompressionBuilderInterface;
}
